import request from '@/config/axios'

// 我的激活码 VO
export interface MyActivationVO {
  id: number // 主键id
  userId: number // 用户id
  activationCode: string // 激活码
}

// 我的激活码 API
export const MyActivationApi = {
  // 查询我的激活码分页
  getActivationPage: async (params: any) => {
    return await request.get({ url: `/member/my-activation/page`, params })
  },

  // 查询我的激活码详情
  getActivation: async (id: number) => {
    return await request.get({ url: `/member/my-activation/get?id=` + id })
  },

  // 新增我的激活码
  createActivation: async (data: MyActivationVO) => {
    return await request.post({ url: `/member/my-activation/create`, data })
  },

  // 修改我的激活码
  updateActivation: async (data: MyActivationVO) => {
    return await request.put({ url: `/member/my-activation/update`, data })
  },

  // 删除我的激活码
  deleteActivation: async (id: number) => {
    return await request.delete({ url: `/member/my-activation/delete?id=` + id })
  },

  // 导出我的激活码 Excel
  exportActivation: async (params) => {
    return await request.download({ url: `/member/my-activation/export-excel`, params })
  }
}
